package org.andromeo;

import org.andromeo.util.CookieSync;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;

public class ImageActivity extends Activity {

	protected static final String LINK = "link";

	private GRSession grsession;
	private String link;

	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		link = getIntent().getExtras().getString(LINK);
		grsession = ((ARApplication) getApplication()).getGrsession();
		
		WebView webview = new WebView(this);
		webview.getSettings().setBuiltInZoomControls(true);
		webview.getSettings().setLoadsImagesAutomatically(true);
		webview.setScrollContainer(true);
		
		setContentView(webview);
		
		// sync cookies
		CookieSync.sync(this, grsession);
		
		webview.loadUrl(link);
	}
}
